home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / PowerPlant / LDelayedTask / LTask.h < prev    next >
Encoding:
Text File  |  1995-08-28  |  2.2 KB  |  81 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //        • LTask.h                    © 1995, Éric Forget. All rights reserved.
  3. // ===========================================================================
  4. //
  5. //    ************************************************************************
  6. //    *                                                                      *
  7. //    *    Before using this code you should read the "License Agreement"     *
  8. //    *    document and agree with it.                                        *
  9. //    *                                                                      *
  10. //    ************************************************************************
  11. //
  12. //    Instruction and usage notes are in the LTask.cp file.
  13. //
  14. // ---------------------------------------------------------------------------
  15.  
  16.  
  17. #pragma once
  18.  
  19.  
  20. // ---------------------------------------------------------------------------
  21. //        • Class LTask
  22. // ---------------------------------------------------------------------------
  23.  
  24. class LTask {
  25.  
  26. public:
  27.                                 LTask();
  28.                                 LTask(    Int32    inFirstDelay,
  29.                                         Int32    inNextDelay,
  30.                                         Boolean inDeleteOnCompletion);
  31.     virtual                        ~LTask();
  32.     
  33.     virtual void                StartTask();
  34.     virtual void                StopTask();
  35.     
  36.     Boolean                        HasDeleteOnCompletion()
  37.                                 {
  38.                                     return mDeleteOnCompletion;
  39.                                 }
  40.     void                        SetDeleteOnCompletion(Boolean inHasDeleteOnCompletion)
  41.                                 {
  42.                                     mDeleteOnCompletion = inHasDeleteOnCompletion;
  43.                                 }
  44.     Int32                        GetFirstDelay()
  45.                                 {
  46.                                     return mFirstDelay;
  47.                                 }
  48.     void                        SetFirstDelay(Int32 inFirstDelay)
  49.                                 {
  50.                                     mFirstDelay = inFirstDelay;
  51.                                 }
  52.     
  53.     Int32                        GetNextDelay()
  54.                                 {
  55.                                     return mNextDelay;
  56.                                 }
  57.     void                        SetNextDelay(Int32 inFirstDelay)
  58.                                 {
  59.                                     mFirstDelay = inFirstDelay;
  60.                                 }
  61.     
  62.     Boolean                        IsExecuting()
  63.                                 {
  64.                                     return mIsExecuting;
  65.                                 }
  66.     
  67. protected:
  68.     Int32                        mFirstDelay;
  69.     Int32                        mNextDelay;
  70.     Boolean                        mIsExecuting;
  71.     Boolean                        mDeleteOnCompletion;
  72.     
  73.     
  74.     virtual void                ExecuteTask();
  75.     virtual void                ContinueTask();
  76.     
  77.     virtual void                StartTaskSelf() = 0;
  78.     virtual void                ExecuteTaskSelf(Boolean &ioLastCall) = 0;
  79.     virtual void                StopTaskSelf() = 0;
  80. };
  81.